<?php

/**
 * @author: biggege
 * @since:  2021-11-30 15:33:57
 */
namespace App\Console\Commands;

use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use App\Models\Admin;
use App\Models\Children;
use App\Models\FollowUp;
use App\Models\PrepareCourse;
use App\Models\File;
use App\Models\FileMapping;


class FileData extends Command
{
    /**
     * The name and signature of the console command.
     * php74 artisan command:filedata
     * @var string
     */
    protected $signature = 'command:filedata';

    /**
     * The console command description.cd .
     *
     * @var string
     */
    protected $description = '导入旧数据';

    /**
     * 每次处理条目数
     * @var int
     */
    protected $pageSize = 500;

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        ini_set('memory_limit', '1024M');
        set_time_limit(0);

        parent::__construct();
    }

    public function handle()
    {
        $this->info('开始导入家访随访文件资源数据，请稍等。。。');
        $this->followUp();
        $this->info("家访随访文件资源数据导入完成");
        

        $this->info('开始导入备课文件资源数据，请稍等。。。');
        $this->prepareCourse();
        $this->info("备课文件资源数据导入完成");
    }

}